<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title></title>
		<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
		<!-- 引用Vue -->
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<!-- 引入组件库 -->
		<script src="https://unpkg.com/element-ui/lib/index.js"></script>
		<script type="text/javascript" src="../js/axios.js"></script>
		<script type="text/javascript" src="../js/qs.js"></script>
		<link href="../css/zcss/summernote.css" rel="stylesheet">
		<link href="../css/zcss/bootstrap-datepicker3.min.css" rel="stylesheet">
		<link href="../css/zcss/switchery.min.css" rel="stylesheet">
		<link href="../css/zcss/bootstrap-clockpicker.min.css" rel="stylesheet">
		<link href="../css/zcss/bootstrap-table.min.css" rel="stylesheet" type="text/css">
		<link href="../css/zcss/bootstrap.min.css" rel="stylesheet" type="text/css">
		<link href="../css/zcss/bootstrap-select.min.css" rel="stylesheet" type="text/css">
		<link href="../css/zcss/core.css" rel="stylesheet" type="text/css">
		<link href="../css/zcss/components.css" rel="stylesheet" type="text/css">
		<link href="http://cdn.xtcrm.com/cdn//v7/fm/ub/css/icons.css" rel="stylesheet" type="text/css">
		<link href="../css/zcss/pages.css" rel="stylesheet" type="text/css">
		<link href="../css/zcss/responsive.css" rel="stylesheet" type="text/css">
		<link href="../css/zcss/sweetalert.min.css" rel="stylesheet" type="text/css">
		<link href="../css/zcss/custombox.min.css" rel="stylesheet">
		<link href="../css/zcss/animate.min.css" rel="stylesheet" type="text/css">
		<link href="../css/zcss/css.css" rel="stylesheet" type="text/css">
		<style>
			* {
				margin: 0;
				padding: 0;
			}
			
			.app {
				width: 780px;
				height: 800px;
				margin: 0 auto;
			}
		</style>
	</head>

	<body>
		<div id="app" class="app">
		
			<hr style="margin-bottom: 20px"/>
			<el-form :model="form" :rules="rules" ref="form" label-width="100px" class="demo-ruleForm">
				
				<el-form-item label="报价主题" prop="theme">
					<el-col :span="22">
						<el-input v-model="form.theme"></el-input>
					</el-col>
				</el-form-item>
				<el-form-item label="客户" prop="custname">
					<el-col :span="22">
						<el-input v-model="form.custname" disabled></el-input>
					</el-col>
				</el-form-item>

				<el-form-item>
					<el-autocomplete class="inline-input" v-model="form.custname" :fetch-suggestions="querySearch" placeholder="请输入内容" :trigger-on-focus="false" @select="handleSelect">
						
						<template slot-scope="{ item }" >
						
							<div style="width:1000px;" class="name">{{ item.cus_name }}({{ item.cus_credate }}{{item.cus_id}})</div>
							
						</template>
						
					</el-autocomplete>
				</el-form-item>

				<el-form-item label="日期" >
					<el-col :span="9">
<<<<<<< HEAD
						<el-date-picker type="date" placeholder="选择日期" v-model="form.dates" style="width: 100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :picker-options="pickerOptions1"></el-date-picker>
					</el-col>
				</el-form-item>
				
				<el-form-item label="报价" prop="price">
					<el-col :span="22">
						<el-input v-model="form.price">{{sums}}</el-input>
					</el-col>
				</el-form-item>
				
				<el-form-item label="销售机会">
					<el-col :span="10">
						<el-form-item prop="opp">
							<template>
								<el-select v-model="form.oppname" @change="changesa" placeholder="请选择">
									 <el-option v-for="item in opp" :key="item.opp_ids"
									 :label="item.opp_name" :value="item.opp_ids"> 
								</el-select>
							</template>
						</el-form-item>
					</el-col>
					<el-col :span="10">
						<el-form-item label="预估毛利">
							<el-col :span="22">
								<el-input v-model="form.maoli" disabled></el-input>
							</el-col>
						</el-form-item>
					</el-col>
				</el-form-item>

				<el-form-item label="明细:">
										<div style="margin-left: 7%; text-align: right;">
											<span style="line-height: normal"> 
											<el-button type="text" class="f-s-12 text-black" @click="getOrderHref()">编辑明细</el-button>
											
											&nbsp;&nbsp; <a
												class="f-s-12 text-black"
												href="javascript:vopen('/sys/editprice/orderprint.xt?coid=174&amp;mdb=e2c323','print',960,530);"><i
													class="ion-printer m-r-5"></i>打印订单</a>&nbsp;&nbsp;<a
												class="f-s-12 text-black" href="javascript:void(0);"
												onclick="javascript:openbasepop('导出word打印', 'print_word', 'mdb=752fbc&amp;id=0&amp;type=order&amp;t_id=174&amp;t_mdb=e2c323&amp;vparse=amF2YXNjcmlwdDp2b3BlbignL3N5cy9lZGl0cHJpY2Uvb3JkZXJwcmludC54dD9jb2lkPTE3NCZtZGI9ZTJjMzIzJnNpZD0xODUmc3NuPW5sNWNtNmtpYXR0YWM3cGl2cTY2ams2Njk0JmNjbj1kMDAyJmNyPTEzZjMxNjUyMzhiOWUwZmFjNGU4NmE0NWU5MzFmZjU5JywncHJpbnQnLDIwMCwyMDApOw==', this, 300, 200);"><i
													class="fa fa-file-word-o m-r-5"></i>导出word打印</a>&nbsp;&nbsp;<a
												class="f-s-12 text-black"
												href="/sys/editprice/orderprint.xt?coid=174&amp;mdb=e2c323&amp;sid=185&amp;ssn=nl5cm6kiattac7pivq66jk6694&amp;ccn=d002&amp;cr=13f3165238b9e0fac4e86a45e931ff59&amp;te=1"><i
													class="fa fa-file-excel-o m-r-5"></i>导出excel打印</a>
												</span>
												<div class="bootstrap-table" style="overflow: auto;">
												
													<div class="fixed-table-container">
													
												<table class="table table-bordered table-hover"
													id="tb_orderDetail">
													<thead>
														<tr>
															<th style="text-align: center" class="th-inner"><span
																style="font-family: 楷体">序号</span></th>
															<th style="text-align: left" class="th-inner"><span
																style="font-family: 楷体">商品</span></th>
															<th style="text-align: right" class="th-inner"><span
																style="font-family: 楷体">单位</span></th>
															<th style="text-align: right" class="th-inner"><span
																style="font-family: 楷体">数量</span></th>

															<th style="text-align: right" class="th-inner"><span
																style="font-family: 楷体">单价</span></th>
															<th style="text-align: right" class="th-inner"><span
																style="font-family: 楷体">金额</span></th>
														</tr>
													</thead>
													<tbody>

														<!--订单明细-->
														<tr v-for="(colle,i) in tableItem">
															<td class="text-center">{{i+1}}</td>
															<td class="text-left">{{colle.goods.gooName}} <a
																href=""><i
																	class="fa fa-folder-open" data-toggle="tooltip"
																	data-placement="bottom" data-original-title="打开详细页面"></i>
																	<!-- '/productdesc?id='+colle.goods.gooId -->
																	</a>
															</td>
							
															<td class="text-left">-</td>
															<td class="text-right">{{colle.quatity}}</td>
															
															<td style="white-space: nowrap;" class="text-right"><span
																style="white-space: nowrap"><span
																	style="font-size: 9pt; font-weight: normal;">￥</span>{{colle.goods.gooPrice}}</span>
															</td>
															<td style="white-space: nowrap;" class="text-right"><span
																style="white-space: nowrap"><span
																	style="font-size: 9pt; font-weight: normal;">￥</span>{{colle.sum}}</span>
															</td>

														</tr>
														<!--订单明细-->


														<tr>
															<td  class="text-left"><font face="楷体"><b>合计</b></font>
															</td>
															<td></td>
															<td style="white-space: nowrap;" class="text-right"></td>
											
															<td  style="white-space: nowrap;" class="text-right">{{quatitys}}<span
																style="white-space: nowrap"></span>
															</td>
															<td>
															</td>
															<td>
															<span
																	style="font-size: 9pt; font-weight: normal;">￥</span>{{sums}}</span>
															</td>
														</tr>

														<tr>
															<td colspan="2" align="left"><font face="楷体">总计（大写金额）</font>
															</td>
															<td colspan="4" align="right"><font face="楷体">{{strchina}}整</font>
															</td>
														</tr>

													</tbody>
												</table>
													</div>
												</div>
										
										</div>
										
										
										
				</el-form-item>
				<el-form-item label="接收人">
					<el-col :span="10">
						<el-form-item >
							<template>
								<el-select v-model="form.linName" @change="handleSelect1">
									<el-option v-for="item in customertoman" :key="item.linId" :label="item.linName" :value="item.linId">
								</el-select>
							</template>
						</el-form-item>
					</el-col>
					<el-col :span="10">
						<el-form-item label="报价人" >
							
						${username}
					
						</el-form-item>
					</el-col>
				</el-form-item>
				<el-form-item label="备注">
					<el-col :span="22">
						<el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4}" :rows="4" placeholder="请输入内容" v-model="form.more">
						</el-input>
					</el-col>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" @click="submitForm('form')">立即创建</el-button>
					<el-button @click="resetForm('form')">重置</el-button>
				</el-form-item>
			</el-form>
		</div>
		<script>
			var vm = new Vue({
				el: "#app",
				data() {
					return {
						centerDialogVisible: false,
						customertoman:[],
						opp:[],
						pickerOptions1: { //时间做约束
							disabledDate(time) {
								return time.getTime() > Date.now() - 8.64e5;
							}
						},
						tableItem:[],
						quatitys:'',
						strchina:'',
						sums:'',
						form: {
							id:'',
							theme: '',
							custname: '',
							custid:'',
							linId: '',
							linName:'',
							dates: '',
							price: '',
							opp: '',
							oppname:'',
							maoli: '',
							user: '',
							celve: '',
							more: '',
							restaurants: []
						},
						//验证规则
						rules: { //数据源model
							user: [{

								required: true,
								message: '请选择接收人',
								trigger: 'blur'
							}],
							user: [{

								required: true,
								message: '请选择负责人',
								trigger: 'change'
							}],
							price: [
								//数据类型要是date
								{
									required: true,
									message: '请输入价格',
									trigger: 'change'
								},
								{pattern: /^[0-9]*$/, message: '金额格式错误'}
							],
							maoli: [
								//数据类型要是date
								{
									required: true,
									message: '请输入价格',
									trigger: 'change'
								}
							],
							dates: [
								//数据类型要是date
								{
									type: 'date',
									required: true,
									message: '请选择时间',
									trigger: 'change'
								}
							],
							theme: [{
								required: true,
								message: '请选择主题',
								trigger: 'blur'
							}],
							custname: [{
								required: true,
								message: '请选择客户人',
								trigger: 'blur'
							}],

							oppname: [
								//数据类型要是date
								{
									required: true,
									message: '请选择机会',
									trigger: 'change'
								}
							]
						}
					}
				},
				methods: {
					getOrderHref(){
						var str = JSON.stringify(this.form);
						sessionStorage.obj = str;
						/* sessionStorage.setItem("theme", this.form.theme);
						sessionStorage.setItem("custname", this.form.custname);
						sessionStorage.setItem("custid", this.form.custid);
						sessionStorage.setItem("linId", this.form.linId);
						sessionStorage.setItem("price", this.form.price);
						
						sessionStorage.setItem("opp", this.form.opp);
						sessionStorage.setItem("oppname", this.form.oppname);
						sessionStorage.setItem("maoli", this.form.maoli);
						sessionStorage.setItem("user", this.form.user);
						sessionStorage.setItem("celve", this.form.celve);
						sessionStorage.setItem("more", this.form.more); */
						window.parent.location.replace("/offerGoodDetail");
					},
					submitForm(formName) {
						//验证方法
						this.$refs[formName].validate((valid) => {
							this.centerDialogVisible = true;
							if(valid) {
								//post提交数据
								var ax = "/editeroffersform";
								if (JSON.stringify(${OfferBoxAllJson}) == '{}') {
									 
									ax = "/offersform";
								}
								
								axios.post(ax,
									//参数转换
									Qs.stringify(this.form, {
										arrayFormat: 'brackets'
									})
									//ajax请求成功的回调函数
								).then(function(v) {
									 window.sessionStorage.clear();
									 window.parent.location.replace("/getBaojiawcx");
									
									 alert(this.form.price);
								}).catch(function() {
									
								});
							
							} else {
								console.log('error submit!!');
								return false;
							}
						});
					},
					resetForm(formName) {
						this.$refs[formName].resetFields();
						 window.sessionStorage.clear();
					},
					querySearch: function(queryString, cb) {
						 var allarr = this.form.restaurants;
				    	var newsarr = [];
							allarr.forEach(v => {
								 var strs =v.cus_name+"";
								 if (strs.indexOf(queryString) >= 0) {
										newsarr.push(v);
										console.info(strs);
										console.info(v);
									} 
							})
							// 调用 callback 返回建议列表的数据
							cb(newsarr);
					},
					handleSelect: function(it) {
						console.log(it.cus_name);
						this.form.custname=it.cus_name;
						this.form.custid=it.cus_id;
						 var iosnn=this;
							//post提交数据
							axios.post("/onSale/findByCoustomerName",
								//参数转换
								Qs.stringify({'custid':this.form.custid}, {
									arrayFormat: 'brackets'
								})		
							).then(function(v) {
								iosnn.customertoman = v.data.custo;
								iosnn.opp = v.data.opp;
							console.log(v.data);
								
							}).catch(function(e) {
								alert("出错了"+e);
							});
					},
					handleSelect1: function(it) {
						this.form.linId=it;					
					},
					changesa: function(it) {
						// this.form.price=tableItem.price;
						this.form.opp=it;	
						alert(it);
					},
					
				},
				mounted() {
					var dic=${dictionaryitem};
					//console.log(dic); 
					var mas=${mansitem};
					this.form.restaurants = mas;
					
					//查询订单明细
					var cart=${OfferBoxAllJson};
					this.tableItem = cart.map;
					
					this.sums=cart.price;
					this.quatitys=cart.quatitys;
					this.strchina=cart.chinas;	
					
					var offer =${offer};
					
					if(JSON.stringify(${offer}) != '{}'){
					this.form.theme = offer.off_name;
					
					
					this.form.custname = offer.cus_name;
					this.form.custid = offer.cus_id;
					
					this.form.id = offer.off_id
=======
						<el-date-picker type="date" placeholder="选择日期" v-model="form.dates" style="width: 100%;"></el-date-picker>
					</el-col>
				</el-form-item>
				
				<el-form-item label="报价" prop="price">
					<el-col :span="22">
						<el-input v-model="form.price">{{sums}}</el-input>
					</el-col>
				</el-form-item>
				
				<el-form-item label="销售机会">
					<el-col :span="10">
						<el-form-item prop="opp">
							<template>
								<el-select v-model="form.oppname" @change="changesa" placeholder="请选择">
									 <el-option v-for="item in opp" :key="item.opp_ids"
									 :label="item.opp_name" :value="item.opp_ids"> 
								</el-select>
							</template>
						</el-form-item>
					</el-col>
					<el-col :span="10">
						<el-form-item label="预估毛利">
							<el-col :span="22">
								<el-input v-model="form.maoli" disabled></el-input>
							</el-col>
						</el-form-item>
					</el-col>
				</el-form-item>

				<el-form-item label="明细:">
										<div style="margin-left: 7%; text-align: right;">
											<span style="line-height: normal"> 
											<el-button type="text" class="f-s-12 text-black" @click="getOrderHref()">编辑明细</el-button>
											
											&nbsp;&nbsp; <a
												class="f-s-12 text-black"
												href="javascript:vopen('/sys/editprice/orderprint.xt?coid=174&amp;mdb=e2c323','print',960,530);"><i
													class="ion-printer m-r-5"></i>打印订单</a>&nbsp;&nbsp;<a
												class="f-s-12 text-black" href="javascript:void(0);"
												onclick="javascript:openbasepop('导出word打印', 'print_word', 'mdb=752fbc&amp;id=0&amp;type=order&amp;t_id=174&amp;t_mdb=e2c323&amp;vparse=amF2YXNjcmlwdDp2b3BlbignL3N5cy9lZGl0cHJpY2Uvb3JkZXJwcmludC54dD9jb2lkPTE3NCZtZGI9ZTJjMzIzJnNpZD0xODUmc3NuPW5sNWNtNmtpYXR0YWM3cGl2cTY2ams2Njk0JmNjbj1kMDAyJmNyPTEzZjMxNjUyMzhiOWUwZmFjNGU4NmE0NWU5MzFmZjU5JywncHJpbnQnLDIwMCwyMDApOw==', this, 300, 200);"><i
													class="fa fa-file-word-o m-r-5"></i>导出word打印</a>&nbsp;&nbsp;<a
												class="f-s-12 text-black"
												href="/sys/editprice/orderprint.xt?coid=174&amp;mdb=e2c323&amp;sid=185&amp;ssn=nl5cm6kiattac7pivq66jk6694&amp;ccn=d002&amp;cr=13f3165238b9e0fac4e86a45e931ff59&amp;te=1"><i
													class="fa fa-file-excel-o m-r-5"></i>导出excel打印</a>
												</span>
												<div class="bootstrap-table" style="overflow: auto;">
												
													<div class="fixed-table-container">
													
												<table class="table table-bordered table-hover"
													id="tb_orderDetail">
													<thead>
														<tr>
															<th style="text-align: center" class="th-inner"><span
																style="font-family: 楷体">序号</span></th>
															<th style="text-align: left" class="th-inner"><span
																style="font-family: 楷体">商品</span></th>
															<th style="text-align: right" class="th-inner"><span
																style="font-family: 楷体">单位</span></th>
															<th style="text-align: right" class="th-inner"><span
																style="font-family: 楷体">数量</span></th>

															<th style="text-align: right" class="th-inner"><span
																style="font-family: 楷体">单价</span></th>
															<th style="text-align: right" class="th-inner"><span
																style="font-family: 楷体">金额</span></th>
														</tr>
													</thead>
													<tbody>

														<!--订单明细-->
														<tr v-for="(colle,i) in tableItem">
															<td class="text-center">{{i+1}}</td>
															<td class="text-left">{{colle.goods.gooName}} <a
																href=""><i
																	class="fa fa-folder-open" data-toggle="tooltip"
																	data-placement="bottom" data-original-title="打开详细页面"></i>
																	<!-- '/productdesc?id='+colle.goods.gooId -->
																	</a>
															</td>
							
															<td class="text-left">-</td>
															<td class="text-right">{{colle.quatity}}</td>
															
															<td style="white-space: nowrap;" class="text-right"><span
																style="white-space: nowrap"><span
																	style="font-size: 9pt; font-weight: normal;">￥</span>{{colle.goods.gooPrice}}</span>
															</td>
															<td style="white-space: nowrap;" class="text-right"><span
																style="white-space: nowrap"><span
																	style="font-size: 9pt; font-weight: normal;">￥</span>{{colle.sum}}</span>
															</td>

														</tr>
														<!--订单明细-->


														<tr>
															<td  class="text-left"><font face="楷体"><b>合计</b></font>
															</td>
															<td></td>
															<td style="white-space: nowrap;" class="text-right"></td>
											
															<td  style="white-space: nowrap;" class="text-right">{{quatitys}}<span
																style="white-space: nowrap"></span>
															</td>
															<td>
															</td>
															<td>
															<span
																	style="font-size: 9pt; font-weight: normal;">￥</span>{{sums}}</span>
															</td>
														</tr>

														<tr>
															<td colspan="2" align="left"><font face="楷体">总计（大写金额）</font>
															</td>
															<td colspan="4" align="right"><font face="楷体">{{strchina}}整</font>
															</td>
														</tr>

													</tbody>
												</table>
													</div>
												</div>
										
										</div>
										
										
										
				</el-form-item>
				<el-form-item label="接收人">
					<el-col :span="10">
						<el-form-item >
							<template>
								<el-select v-model="form.linName" @change="handleSelect1">
									<el-option v-for="item in customertoman" :key="item.linId" :label="item.linName" :value="item.linId">
								</el-select>
							</template>
						</el-form-item>
					</el-col>
					<el-col :span="10">
						<el-form-item label="报价人" >
							
						${username}
					
						</el-form-item>
					</el-col>
				</el-form-item>
				<el-form-item label="备注">
					<el-col :span="22">
						<el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4}" :rows="4" placeholder="请输入内容" v-model="form.more">
						</el-input>
					</el-col>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" @click="submitForm('form')">立即创建</el-button>
					<el-button @click="resetForm('form')">重置</el-button>
				</el-form-item>
			</el-form>
		</div>
		<script>
			var vm = new Vue({
				el: "#app",
				data() {
					return {
						centerDialogVisible: false,
						customertoman:[],
						opp:[],
						tableItem:[],
						quatitys:'',
						strchina:'',
						sums:'',
						form: {
							theme: '',
							custname: '',
							custid:'',
							linId: '',
							linName:'',
							dates: '',
							price: '',
							opp: '',
							oppname:'',
							maoli: '',
							user: '',
							celve: '',
							more: '',
							restaurants: []
						},
						//验证规则
						rules: { //数据源model
							user: [{

								required: true,
								message: '请选择接收人',
								trigger: 'blur'
							}],
							user: [{

								required: true,
								message: '请选择负责人',
								trigger: 'change'
							}],
							price: [
								//数据类型要是date
								{
									required: true,
									message: '请输入价格',
									trigger: 'change'
								},
								{pattern: /^[0-9]*$/, message: '金额格式错误'}
							],
							maoli: [
								//数据类型要是date
								{
									required: true,
									message: '请输入价格',
									trigger: 'change'
								}
							],
							dates: [
								//数据类型要是date
								{
									type: 'date',
									required: true,
									message: '请选择时间',
									trigger: 'change'
								}
							],
							theme: [{
								required: true,
								message: '请选择主题',
								trigger: 'blur'
							}],
							custname: [{
								required: true,
								message: '请选择客户人',
								trigger: 'blur'
							}],

							oppname: [
								//数据类型要是date
								{
									required: true,
									message: '请选择机会',
									trigger: 'change'
								}
							]
						}
					}
				},
				methods: {
					getOrderHref(){
						var str = JSON.stringify(this.form);
						sessionStorage.obj = str;
						/* sessionStorage.setItem("theme", this.form.theme);
						sessionStorage.setItem("custname", this.form.custname);
						sessionStorage.setItem("custid", this.form.custid);
						sessionStorage.setItem("linId", this.form.linId);
						sessionStorage.setItem("price", this.form.price);
						
						sessionStorage.setItem("opp", this.form.opp);
						sessionStorage.setItem("oppname", this.form.oppname);
						sessionStorage.setItem("maoli", this.form.maoli);
						sessionStorage.setItem("user", this.form.user);
						sessionStorage.setItem("celve", this.form.celve);
						sessionStorage.setItem("more", this.form.more); */
						window.parent.location.replace("/offerGoodDetail");
					},
					submitForm(formName) {
						//验证方法
						this.$refs[formName].validate((valid) => {
							this.centerDialogVisible = true;
							if(valid) {
								//post提交数据
								axios.post("offersform",
									//参数转换
									Qs.stringify(this.form, {
										arrayFormat: 'brackets'
									})
									//ajax请求成功的回调函数
								).then(function(v) {
									 window.sessionStorage.clear();
									 window.parent.location.replace("/getBaojiawcx");
									
									 alert(this.form.price);
								}).catch(function() {
									alert("出错了");
								});
							
							} else {
								console.log('error submit!!');
								return false;
							}
						});
					},
					resetForm(formName) {
						this.$refs[formName].resetFields();
						 window.sessionStorage.clear();
					},
					querySearch: function(queryString, cb) {
						 var allarr = this.form.restaurants;
				    	var newsarr = [];
							allarr.forEach(v => {
								 var strs =v.cus_name+"";
								 if (strs.indexOf(queryString) >= 0) {
										newsarr.push(v);
										console.info(strs);
										console.info(v);
									} 
							})
							// 调用 callback 返回建议列表的数据
							cb(newsarr);
					},
					handleSelect: function(it) {
						console.log(it.cus_name);
						this.form.custname=it.cus_name;
						this.form.custid=it.cus_id;
						 var iosnn=this;
							//post提交数据
							axios.post("/onSale/findByCoustomerName",
								//参数转换
								Qs.stringify({'custid':this.form.custid}, {
									arrayFormat: 'brackets'
								})		
							).then(function(v) {
								iosnn.customertoman = v.data.custo;
								iosnn.opp = v.data.opp;
							console.log(v.data);
								
							}).catch(function(e) {
								alert("出错了"+e);
							});
					},
					handleSelect1: function(it) {
						this.form.linId=it;					
					},
					changesa: function(it) {
						// this.form.price=tableItem.price;
						this.form.opp=it;	
						alert(it);
					},
					
				},
				mounted() {
					var dic=${dictionaryitem};
					//console.log(dic); 
					var mas=${mansitem};
					this.form.restaurants = mas;
					
					//查询订单明细
					var cart=${OfferBoxAllJson};
					this.tableItem = cart.map;
					
					this.sums=cart.price;
					this.quatitys=cart.quatitys;
					this.strchina=cart.chinas;	
					
					var offer =${offer};
					
					if(JSON.stringify(${offer}) != '{}'){
					this.form.theme = offer.off_name;
					
					
					this.form.custname = offer.cus_name;
					this.form.custid = offer.cus_id;
					
					
>>>>>>> refs/remotes/origin/产品
					this.form.linId = offer.lin_id;
					this.form.linName = offer.lin_name;
					this.form.price = offer.off_offer;
					this.form.oppname = offer.opp_name;
					this.form.opp = offer.opp_id;
					this.form.maoli = offer.off_profit;
					this.form.user = offer.use_name;
					this.form.celve = offer.opp_celv;
					this.form.more = offer.opp_remark;
					
					}
					var str = sessionStorage.obj;
					var obj = JSON.parse(str);
					this.form = obj;
					
					var its ={"cus_name":this.form.custname, "cus_id":this.form.custid};
					this.handleSelect(its);
					
						/* sessionStorage.setItem("custid", this.form.custid);
						sessionStorage.setItem("linId", this.form.linId);
						sessionStorage.setItem("price", this.form.price);
						
						sessionStorage.setItem("opp", this.form.opp);
						sessionStorage.setItem("oppname", this.form.oppname);
						sessionStorage.setItem("maoli", this.form.maoli);
						sessionStorage.setItem("user", this.form.user);
						sessionStorage.setItem("celve", this.form.celve);
						sessionStorage.setItem("more", this.form.more); 
						
						this.form.theme = sessionStorage.getItem("theme");
						this.form.custname = sessionStorage.getItem("custname");
						this.form.oppname = sessionStorage.getItem("oppname");*/
				}
			});
		</script>
	</body>

</html>